document.onreadystatechange = function() {
    if (document.readyState == "complete") {
        loadingFade();
        add();
    }

}

function loadingFade() {
    var opacity = 1;
    var loadingPage = document.getElementById('loading');
    var loadingBackground = document.getElementById('loading_bg');
    var time = setInterval(function() {
        if (opacity <= 0) {
            clearInterval(time);
            loadingPage.remove();
            $('#loading').remove();
        }
        loadingBackground.style.opacity = opacity;
        opacity -= 0.4;

    }, 150);
}

function add() {

    const addin = setInterval(function() {
        let roller = document.getElementsByTagName("body")[0];
        roller.setAttribute('id', 'join');
    }, 500);

}